package cn.gson.springboot.model.pjos;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Objects;

    @Entity
    public class Mylog {
    private int id;
    private Emp empId;
    private String type;
    private String content;
    private Timestamp workTime;

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @ManyToOne
    @JoinColumn(name = "emp_id", referencedColumnName = "employees_id")
    public Emp getEmpId() {
        return empId;
    }

    public void setEmpId(Emp empId) {
        this.empId = empId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Basic
    @Column(name = "content", nullable = true, length = 255)
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "work_time", nullable = true)
    public Timestamp getWorkTime() {
        return workTime;
    }

    public void setWorkTime(Timestamp workTime) {
        this.workTime = workTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Mylog mylog = (Mylog) o;
        return id == mylog.id &&
                Objects.equals(empId, mylog.empId) &&
                Objects.equals(type, mylog.type) &&
                Objects.equals(content, mylog.content) &&
                Objects.equals(workTime, mylog.workTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, empId,type, content, workTime);
    }
}
